#include <math.h>
#include "MathRuleConstant.h"

namespace MathRuleConstant
{
double roundBig(double input)
{
  return floor(input*ROUNDRATE+0.5)/ROUNDRATE;
}

double roundSmall(double input)
{
  return floor(input*ROUNDRATE)/ROUNDRATE;
}

bool checkRangeMin(double input, double min, bool equalMin)
{
  return equalMin ? (input >= min):(input>min);
}

bool checkRangeMax(double input, double max, bool equalMax)
{
  return equalMax ? (input <= max):(input < max);
}

bool checkRange(double input, double min, bool equalMin, double max, bool equalMax)
{
  return checkRangeMin(input,min,equalMin) && checkRangeMax(input,max,equalMax);
}
}
